package com.ml.mall.utils;

import com.ml.mall.consts.CommonConsts;
import com.ml.mall.consts.CommonConsts;
import com.ml.mall.entity.sys.SysUser;
import com.ml.mall.security.JwtUtil;

/**
 * @author :pl
 * @version :1.0
 * @description :Redis信息比对工具
 * @date :2021/5/31
 **/
public class ComparisonUtils {
    //获取当前用户redis的key
    public static String getCurComparisonKey(){
        //1.首先需要获取用户基本信息
        SysUser currentUser = JwtUtil.getCurrentUser();
        //2.使用MD5进行盐加密
        String str = MD5.md5(currentUser.getAcc(), currentUser.getSalt());
        return CommonConsts.COMPARISON_KEY+str;
    }
}
